/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.util.Calendar;
import model.PedidosModel;
import controller.PedidosControl;

/**
 *
 * @author Bruno
 */
public class Pedidos extends javax.swing.JInternalFrame {

    /**
     * Creates new form Pedidos
     */
    PedidosControl PedidosControle= new PedidosControl();
    public Pedidos() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        lblNomePedidos = new javax.swing.JLabel();
        txtNomePedidos = new javax.swing.JTextField();
        txtEnderecoPedidos = new javax.swing.JTextField();
        btnPesquisarClientesPedidos = new javax.swing.JButton();
        cmbxEstadoPedido = new javax.swing.JComboBox();
        txtNumeroClientePedidos = new javax.swing.JTextField();
        lblEnderecoPedidos = new javax.swing.JLabel();
        lblEstadoPedido = new javax.swing.JLabel();
        txtBairroClientePedidos = new javax.swing.JTextField();
        lblBairroClientePedidos = new javax.swing.JLabel();
        lblNumeroClientePedidos = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        lblNumPedido = new javax.swing.JLabel();
        txtNumPedido = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        lblPesquisarTelefonePedidos = new javax.swing.JLabel();
        txtPesquisarTelefonePedidos = new javax.swing.JTextField();
        txtComplementoPedidos = new javax.swing.JTextField();
        lblComplementoPedidos = new javax.swing.JLabel();
        btnNovoPedido = new javax.swing.JButton();
        btnEditarPedido = new javax.swing.JButton();
        btnCancelarPedido = new javax.swing.JButton();
        btnSalvarPedido = new javax.swing.JButton();
        btnSairPedido = new javax.swing.JButton();
        PanelProdutosSelecionadosPedidos = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblPedidosSelecionados = new javax.swing.JTable();
        jScrollPane1 = new javax.swing.JScrollPane();
        lstPesquisarProdutos = new javax.swing.JList();
        rdbtnPizzaPedidos = new javax.swing.JRadioButton();
        rdbtnBebidaPedidos = new javax.swing.JRadioButton();
        rdbtnOutrosPedidos = new javax.swing.JRadioButton();
        btnAdicionar = new javax.swing.JButton();
        lblFormaPagamentoPedidos = new javax.swing.JLabel();
        cmbxFormaPagamentoPedidos = new javax.swing.JComboBox();
        jPanel3 = new javax.swing.JPanel();
        lblTotalPedido = new javax.swing.JLabel();
        ftxtTotalPedido = new javax.swing.JFormattedTextField();
        btnImprimirPedido = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 231, 63));
        setTitle("Pedidos");
        setMaximumSize(new java.awt.Dimension(995, 571));
        setMinimumSize(new java.awt.Dimension(995, 571));
        setName(""); // NOI18N

        lblNomePedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblNomePedidos.setText("Nome");

        txtNomePedidos.setFont(new java.awt.Font("Arial", 1, 14));

        txtEnderecoPedidos.setFont(new java.awt.Font("Arial", 1, 14));
        txtEnderecoPedidos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtEnderecoPedidosActionPerformed(evt);
            }
        });

        btnPesquisarClientesPedidos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/Pesquisar.png"))); // NOI18N
        btnPesquisarClientesPedidos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPesquisarClientesPedidosActionPerformed(evt);
            }
        });

        cmbxEstadoPedido.setFont(new java.awt.Font("Arial", 1, 14));
        cmbxEstadoPedido.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "- - -", "Aberto", "Fechado", "Cancelado" }));
        cmbxEstadoPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbxEstadoPedidoActionPerformed(evt);
            }
        });

        txtNumeroClientePedidos.setFont(new java.awt.Font("Arial", 1, 14));

        lblEnderecoPedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblEnderecoPedidos.setText("Endereço");

        lblEstadoPedido.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblEstadoPedido.setText("Situação do Pedido");

        txtBairroClientePedidos.setFont(new java.awt.Font("Arial", 1, 14));

        lblBairroClientePedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblBairroClientePedidos.setText("Bairro");

        lblNumeroClientePedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblNumeroClientePedidos.setText("Número");

        jPanel1.setBackground(new java.awt.Color(255, 102, 0));

        lblNumPedido.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblNumPedido.setForeground(new java.awt.Color(255, 255, 255));
        lblNumPedido.setText("N° Pedido");

        txtNumPedido.setBackground(new java.awt.Color(255, 255, 204));
        txtNumPedido.setEditable(false);
        txtNumPedido.setFont(new java.awt.Font("Arial", 1, 20));
        txtNumPedido.setForeground(new java.awt.Color(255, 0, 0));
        txtNumPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNumPedidoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtNumPedido, javax.swing.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lblNumPedido)
                        .addGap(0, 95, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(lblNumPedido)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtNumPedido, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel2.setBackground(new java.awt.Color(255, 102, 0));

        lblPesquisarTelefonePedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblPesquisarTelefonePedidos.setForeground(new java.awt.Color(255, 255, 255));
        lblPesquisarTelefonePedidos.setText("Telefone");

        txtPesquisarTelefonePedidos.setBackground(new java.awt.Color(255, 255, 204));
        txtPesquisarTelefonePedidos.setFont(new java.awt.Font("Arial", 1, 20));
        txtPesquisarTelefonePedidos.setForeground(new java.awt.Color(0, 0, 153));
        txtPesquisarTelefonePedidos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtPesquisarTelefonePedidosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblPesquisarTelefonePedidos)
                    .addComponent(txtPesquisarTelefonePedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(lblPesquisarTelefonePedidos)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtPesquisarTelefonePedidos, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
                .addContainerGap())
        );

        lblComplementoPedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblComplementoPedidos.setText("Complemento");

        btnNovoPedido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/Botoes_5122_paper_48.png"))); // NOI18N
        btnNovoPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNovoPedidoActionPerformed(evt);
            }
        });

        btnEditarPedido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/Botoes_5122_pencil_48.png"))); // NOI18N

        btnCancelarPedido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/Botoes_5123_cancel_48.png"))); // NOI18N
        btnCancelarPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarPedidoActionPerformed(evt);
            }
        });

        btnSalvarPedido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/Botoesaceitar.png"))); // NOI18N
        btnSalvarPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalvarPedidoActionPerformed(evt);
            }
        });

        btnSairPedido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/power icon 64x64.png"))); // NOI18N
        btnSairPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSairPedidoActionPerformed(evt);
            }
        });

        PanelProdutosSelecionadosPedidos.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Produtos Selecionados", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N
        PanelProdutosSelecionadosPedidos.setFont(new java.awt.Font("Tahoma", 0, 12));
        PanelProdutosSelecionadosPedidos.setName(""); // NOI18N

        tblPedidosSelecionados.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Código", "Itens", "Quantidade", "Valor"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, true, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(tblPedidosSelecionados);

        jScrollPane1.setViewportView(lstPesquisarProdutos);

        rdbtnPizzaPedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        rdbtnPizzaPedidos.setText("Pizza");

        rdbtnBebidaPedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        rdbtnBebidaPedidos.setText("Bebida");

        rdbtnOutrosPedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        rdbtnOutrosPedidos.setText("Outros");

        btnAdicionar.setText("+");

        lblFormaPagamentoPedidos.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblFormaPagamentoPedidos.setText("Forma de Pagamento");

        cmbxFormaPagamentoPedidos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "Dinheiro" }));

        jPanel3.setBackground(new java.awt.Color(255, 102, 0));

        lblTotalPedido.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblTotalPedido.setForeground(new java.awt.Color(255, 255, 255));
        lblTotalPedido.setText("TOTAL");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(lblTotalPedido)
                        .addGap(0, 61, Short.MAX_VALUE))
                    .addComponent(ftxtTotalPedido, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lblTotalPedido)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ftxtTotalPedido, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout PanelProdutosSelecionadosPedidosLayout = new javax.swing.GroupLayout(PanelProdutosSelecionadosPedidos);
        PanelProdutosSelecionadosPedidos.setLayout(PanelProdutosSelecionadosPedidosLayout);
        PanelProdutosSelecionadosPedidosLayout.setHorizontalGroup(
            PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelProdutosSelecionadosPedidosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelProdutosSelecionadosPedidosLayout.createSequentialGroup()
                        .addGroup(PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(PanelProdutosSelecionadosPedidosLayout.createSequentialGroup()
                                .addComponent(rdbtnPizzaPedidos)
                                .addGap(18, 18, 18)
                                .addComponent(rdbtnBebidaPedidos)
                                .addGap(18, 18, 18)
                                .addComponent(rdbtnOutrosPedidos)))
                        .addGap(18, 18, 18)
                        .addComponent(btnAdicionar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 242, Short.MAX_VALUE)
                        .addGroup(PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cmbxFormaPagamentoPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblFormaPagamentoPedidos))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 872, Short.MAX_VALUE))
                .addContainerGap())
        );
        PanelProdutosSelecionadosPedidosLayout.setVerticalGroup(
            PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelProdutosSelecionadosPedidosLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelProdutosSelecionadosPedidosLayout.createSequentialGroup()
                        .addGroup(PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(rdbtnPizzaPedidos)
                            .addComponent(rdbtnBebidaPedidos)
                            .addComponent(rdbtnOutrosPedidos))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PanelProdutosSelecionadosPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnAdicionar, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelProdutosSelecionadosPedidosLayout.createSequentialGroup()
                        .addComponent(lblFormaPagamentoPedidos)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmbxFormaPagamentoPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        btnImprimirPedido.setText("Imprimir");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(85, 85, 85)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtBairroClientePedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBairroClientePedidos))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblComplementoPedidos)
                            .addComponent(txtComplementoPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(494, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(btnNovoPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnEditarPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnCancelarPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 262, Short.MAX_VALUE)
                                .addComponent(btnImprimirPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnSalvarPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnSairPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(PanelProdutosSelecionadosPedidos, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(btnPesquisarClientesPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(174, 174, 174)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lblEstadoPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(cmbxEstadoPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lblNomePedidos)
                                            .addComponent(txtNomePedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 410, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(18, 18, 18)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txtEnderecoPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblEnderecoPedidos))
                                        .addGap(18, 18, 18)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lblNumeroClientePedidos)
                                            .addComponent(txtNumeroClientePedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addGap(0, 22, Short.MAX_VALUE)))
                        .addGap(75, 75, 75))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(btnPesquisarClientesPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(lblEstadoPedido)
                                .addGap(6, 6, 6)
                                .addComponent(cmbxEstadoPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(lblNomePedidos)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtNomePedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(lblEnderecoPedidos)
                                .addGap(1, 1, 1)
                                .addComponent(txtEnderecoPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(lblNumeroClientePedidos)
                                .addGap(1, 1, 1)
                                .addComponent(txtNumeroClientePedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(lblBairroClientePedidos)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtBairroClientePedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(lblComplementoPedidos)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtComplementoPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addComponent(PanelProdutosSelecionadosPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 26, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnNovoPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnEditarPedido, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)
                    .addComponent(btnCancelarPedido, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)
                    .addComponent(btnSairPedido, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)
                    .addComponent(btnSalvarPedido, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)
                    .addComponent(btnImprimirPedido, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(20, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void txtEnderecoPedidosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEnderecoPedidosActionPerformed
    // TODO add your handling code here:
}//GEN-LAST:event_txtEnderecoPedidosActionPerformed

private void btnPesquisarClientesPedidosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarClientesPedidosActionPerformed
    PesquisarCliente pc = new PesquisarCliente();
    this.add(pc);
    pc.show();
}//GEN-LAST:event_btnPesquisarClientesPedidosActionPerformed

private void cmbxEstadoPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbxEstadoPedidoActionPerformed
    // TODO add your handling code here:
}//GEN-LAST:event_cmbxEstadoPedidoActionPerformed

private void txtPesquisarTelefonePedidosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisarTelefonePedidosActionPerformed
    // TODO add your handling code here:
}//GEN-LAST:event_txtPesquisarTelefonePedidosActionPerformed

private void btnNovoPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoPedidoActionPerformed
}//GEN-LAST:event_btnNovoPedidoActionPerformed

private void btnCancelarPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarPedidoActionPerformed
}//GEN-LAST:event_btnCancelarPedidoActionPerformed

private void btnSalvarPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarPedidoActionPerformed
PedidosModel Pedidos= new PedidosModel();

       Pedidos.EstadoPedido=cmbxEstadoPedido.getEditor();
       Pedidos.FormaPagamento=ftxtTotalPedido.getText();
        //Cliente.Endereco=txtEnderecoCliente.getText();
        //Cliente.DataNasc=Calendar.getInstance();
        //Cliente.DataNasc.set(2012, 10, 31); // Alterar por variaveis
        
        //if (ClienteControle.CadastrarCliente(Cliente)) {
        //    lblMensagemCliente.setText("Erro ao cadastrar");
        //    lblMensagemCliente.setVisible(true);
       // }
        //else
        {
        //    lblMensagemCliente.setText("Cadastrado com sucesso");
        //    lblMensagemCliente.setVisible(true);
        }
}//GEN-LAST:event_btnSalvarPedidoActionPerformed

private void btnSairPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairPedidoActionPerformed
    this.dispose();
}//GEN-LAST:event_btnSairPedidoActionPerformed

    private void txtNumPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNumPedidoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtNumPedidoActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel PanelProdutosSelecionadosPedidos;
    private javax.swing.JButton btnAdicionar;
    private javax.swing.JButton btnCancelarPedido;
    private javax.swing.JButton btnEditarPedido;
    private javax.swing.JButton btnImprimirPedido;
    private javax.swing.JButton btnNovoPedido;
    private javax.swing.JButton btnPesquisarClientesPedidos;
    private javax.swing.JButton btnSairPedido;
    private javax.swing.JButton btnSalvarPedido;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JComboBox cmbxEstadoPedido;
    private javax.swing.JComboBox cmbxFormaPagamentoPedidos;
    private javax.swing.JFormattedTextField ftxtTotalPedido;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel lblBairroClientePedidos;
    private javax.swing.JLabel lblComplementoPedidos;
    private javax.swing.JLabel lblEnderecoPedidos;
    private javax.swing.JLabel lblEstadoPedido;
    private javax.swing.JLabel lblFormaPagamentoPedidos;
    private javax.swing.JLabel lblNomePedidos;
    private javax.swing.JLabel lblNumPedido;
    private javax.swing.JLabel lblNumeroClientePedidos;
    private javax.swing.JLabel lblPesquisarTelefonePedidos;
    private javax.swing.JLabel lblTotalPedido;
    private javax.swing.JList lstPesquisarProdutos;
    private javax.swing.JRadioButton rdbtnBebidaPedidos;
    private javax.swing.JRadioButton rdbtnOutrosPedidos;
    private javax.swing.JRadioButton rdbtnPizzaPedidos;
    private javax.swing.JTable tblPedidosSelecionados;
    private javax.swing.JTextField txtBairroClientePedidos;
    private javax.swing.JTextField txtComplementoPedidos;
    private javax.swing.JTextField txtEnderecoPedidos;
    private javax.swing.JTextField txtNomePedidos;
    private javax.swing.JTextField txtNumPedido;
    private javax.swing.JTextField txtNumeroClientePedidos;
    private javax.swing.JTextField txtPesquisarTelefonePedidos;
    // End of variables declaration//GEN-END:variables
}
